package com.ganxiang.ximenhong.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.ganxiang.autolayoutlibary.util.AutoUtils;
import com.ganxiang.ximenhong.R;
import com.ganxiang.ximenhong.base.BaseFragment;

/**
 * Created by Administrator on 2016/9/13 0013.
 */
public class ShoppingCarFragment extends BaseFragment{

    private View mView;
    private ListView mShoppingCarLv;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mView = View.inflate(mActivity, R.layout.fragment_shoppingcar,null);
        init();
        return mView;
    }

    private void init() {
        mView.findViewById(R.id.iv_back).setVisibility(View.GONE);
        ((TextView)mView.findViewById(R.id.tv_title)).setText(getString(R.string.shoppingcar));
        initLv();
    }

    private void initLv() {
        mShoppingCarLv = (ListView) mView.findViewById(R.id.lv_shoppingcar);
        mShoppingCarLv.setAdapter(new ShoppingCarLvAdapter());
    }
    class ShoppingCarLvAdapter extends BaseAdapter{

        @Override
        public int getCount() {
            return 5;
        }

        @Override
        public Object getItem(int i) {
            return null;
        }

        @Override
        public long getItemId(int i) {
            return 0;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            if(view == null){
                view = View.inflate(mActivity,R.layout.item_shoppingcar,null);
            }
            AutoUtils.autoSize(view);
            return view;
        }
    }
}
